package com.github.tetrisgame.utils;


import androidx.viewbinding.ViewBinding;

import com.google.android.material.bottomsheet.BottomSheetDialog;

public abstract class AlertDialogUtils<T extends ViewBinding> {
    private final T mBinding;
    private final BottomSheetDialog dialog;

    public AlertDialogUtils(T binding) {
        this.mBinding = binding;
        dialog = new BottomSheetDialog(mBinding.getRoot().getContext());
        dialog.setContentView(binding.getRoot());
        initEvent(this.mBinding);
    }

    public void initEvent(T binding) {

    }

    public void show() {
        dialog.show();
    }

    public void dismiss() {
        dialog.dismiss();
    }
}
